package week10th.jsjf;

public class GraphTest {
    public static void main(String[] args) {
        Graph graph = new Graph();
        graph.addVertex("0");
        graph.addVertex("1");
        graph.addVertex("2");
        graph.addVertex("3");
        graph.addVertex("4");
        graph.addVertex("5");
        graph.addVertex("6");

        graph.addEdge("0", "1");
        graph.addEdge("1", "2");
        graph.addEdge("2", "3");
        graph.addEdge("0", "2");
        graph.addEdge("0", "4");
        graph.addEdge("1", "3");

        for (int i = 0; i < graph.vertices.length; i++)
            System.out.print(graph.vertices[i] + " ");
        System.out.println();

        for (int i = 0; i < 7; i++) {
            for (int j = 0; j < 7; j++) {
                if (graph.adjMatrix[i][j] == true)
                    System.out.print(graph.adjMatrix[i][j] + "  ");
                else
                    System.out.print(graph.adjMatrix[i][j] + " ");
            }
            System.out.println();
        }
    }
}
